/*
 * @Descripttion: your project
 * @version: 1.0
 * @Author: sunxiantao
 * @Date: 2022-10-18 17:12:17
 * @LastEditors: sunxiantao
 * @LastEditTime: 2022-10-20 14:04:01
 */

import request from '@/utils/request'
/**
 * 字典
 */
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'POST',
    data: {
      dictCode
    }
  })
}
/**
 * 查询人物库中的讲师
 * @param {*} data
 */
export function queryUserRole(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/craftsmanLibrary/queryPage',
    method: 'post',
    data
  })
}
/**
 * 培训班详情
 * @param {*} data
 */
export function courseDetails(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/get',
    method: 'post',
    data
  })
}
/**
 * 新增培训班
 * @param {*} data
 */
export function addClassResources(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/insert',
    method: 'post',
    data
  })
}
/**
 * 编辑培训班
 * @param {*} data
 */
export function updateClassResources(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/update',
    method: 'post',
    data
  })
}
/**
 * 删除培训班
 * @param {*} data
 */
export function del(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/deleteById',
    method: 'post',
    data
  })
}
/**
 * 查询培训班列表
 * @param {*} data
 */
export function queryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/queryPage',
    method: 'post',
    data
  })
}
/**
 * 查询培训班列表
 * @param {*} data
 */
export function RecordQueryPage(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaHistoryRecord/queryPage',
    method: 'post',
    data
  })
}
/**
 * 更改培训班状态 启用/禁用
 * @param {*} data
 */
export function updateStatus(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/updateStatus',
    method: 'post',
    data
  })
}
/**
 * 更改培训班置顶
 * @param {*} data
 */
export function updateTopping(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/updateTop',
    method: 'post',
    data
  })
}

/**
 * 修改班主任
 * @param {*} data
 */
export function updateClassTeacher(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaDefinition/setTeacher',
    method: 'post',
    data
  })
}
/**
 * 导出票数统计导出
 */
export function exportFile(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/areaHistoryRecord/export',
    method: 'post',
    responseType: 'blob',
    data
  })
}
/**
 * 获取分类树形列表
 */
export function fetchList(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/activityClassify/getClassifyTree',
    method: 'POST',
    data
  })
}